/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
 *
 * @author Jackhit
 */
public class MaHoa {


public static String maHoa_MD5(String text) {
    String result = text;
    try {
        MessageDigest md5 = MessageDigest.getInstance("MD5");
        md5.update(result.getBytes());
        BigInteger bis = new BigInteger(1, md5.digest());
        result = bis.toString(64);
        System.out.println("Chuoi da duoc ma hoa:" + text);
    } catch (NoSuchAlgorithmException ex) {
        System.out.println("khong the ma hoa duoc:" + ex.getMessage());
    }
    return result;
}

}
